package com.senseuni.da.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;

import com.elvishew.xlog.XLog;
import com.senseuni.da.events.ConnectivityEvent;

import org.greenrobot.eventbus.EventBus;


public class ConnectiveBroadcastReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) {
            XLog.d("ConnectivityManager.CONNECTIVITY_ACTION receiver");
            EventBus.getDefault().post(new ConnectivityEvent());
        }
    }
}
